how to find frequency of characters from a word